package com.itheima.day03;

public class Test2 {
    public static void main(String[] args) {
        int[] arrs=new int[0];
        int max = getMax(arrs);
        System.out.println(max);
//        System.out.println(arrs.length);

    }

    //int getMax[int[] arrs
    public static int getMax(int[] arrs) {

        if (arrs.length == 0) {
            throw new ArrayLengthNotZeroException("数组长度不能为空");
        }



        int max=arrs[0];
        for (int i = 0; i < arrs.length; i++) {
            if (arrs[i] > max) {
                max=arrs[i];
            }
        }
        return max;
    }
}
